//账号接口模块

// 1.引入工具函数
import request from '@/utils/request'

// 登录接口函数
export const checkLoginReq = data => {
  //返回axios接口调用结果
  return request({
    method: 'post',
    url: '/users/checkLogin',
    data,
  })
}

//检测重复接口函数
export const checkUserRepeatReq = data => {
  // 返回axios接口调用结果
  return request({
    method: 'post',
    url: '/users/repeat',
    data,
  })
}

//添加接口函数
export const addUserReq = data => {
  // 返回axios接口调用结果
  return request({
    method: 'post',
    url: '/users/add',
    data,
  })
}

//获取用户列表接口
export const getUserListReq = params => {
  return request({
    method: 'get',
    url: '/users/list',
    params,
  })
}

//删除用户请求
export const delUserReq = params => {
  return request({
    method: 'get',
    url: '/users/del',
    params,
  })
}

//删除用户请求
export const editUserReq = data => {
  return request({
    method: 'post',
    url: '/users/edit',
    data,
  })
}

//批量删除用户请求
export const batchDelUserReq = data => {
  return request({
    method: 'post',
    url: '/users/batchdel',
    data,
  })
}

//删除用户接口
export const getUserInFoReq = () => {
  return request({
    method: 'get',
    url: '/users/info',
  })
}

//修改用户头像
export const updateUserAvatarReq = params => {
  return request({
    method: 'get',
    url: '/users/avataredit',
    params,
  })
}
//检查旧密码是否正确
export const checkOldPwdReq = params => {
  return request({
    method: 'get',
    url: '/users/checkoldpwd',
    params,
  })
}
//修改密码
export const editPwdReq = data => {
  return request({
    method: 'post',
    url: '/users/editpwd',
    data,
  })
}

//删除用户接口
export const getUserInfoReq = () => {
  return request({
    method: 'get',
    url: '/users/info',
  })
}
